package cn.zhang.violet.bean


class NewString(val str: String) {

    def toIntPlus = {
        try {
            this.str.toInt
        } catch {
            case _: Exception => 0
        }
    }

    def toDoublePlus = {
        try {
            this.str.toDouble
        } catch {
            case _: Exception => 0d
        }
    }
}

object NewString {

    implicit def StrCrossOverSheep(str: String) = new NewString(str)

}
